﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:currency="clr-namespace:CurrencyTextBoxControl;assembly=CurrencyTextBoxControl"
        x:Class="CurrencyTextBoxExample.MainWindow"
        Title="CurrencyTextBox Example"
        Width="766"
        Height="347"
        FontFamily="Consolas"
        FontSize="18">
    <Grid x:Name="LayoutRoot" Margin="5">

        <Grid Margin="10,46,0,0" HorizontalAlignment="Left" Width="730" Height="31" VerticalAlignment="Top">

            <currency:CurrencyTextBox x:Name="myCurrencyTextBox"
				VerticalAlignment="Center"
				VerticalContentAlignment="Center"
                                  
				Number="{Binding Number, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" HorizontalAlignment="Left" Width="239" Height="31" CanShowAddPanel="True">
                <currency:CurrencyTextBox.Style>
                    <Style TargetType="{x:Type currency:CurrencyTextBox}">
                        <Style.Triggers>
                            <Trigger Property="Validation.HasError" Value="True">
                                <Setter Property="ToolTip" Value="{Binding (Validation.Errors).CurrentItem.ErrorContent, RelativeSource={RelativeSource self}}" />
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </currency:CurrencyTextBox.Style>
            </currency:CurrencyTextBox>

            <TextBlock
				Grid.Column="0"
				Margin="298,6,0,5"
				VerticalAlignment="Center"
				Text="StringFormat:"
				TextAlignment="Right" HorizontalAlignment="Left" Width="172" />
            <ComboBox
				Margin="488,0,0,0"
				HorizontalContentAlignment="Right"
				FontFamily="Consolas"
				ItemsSource="{Binding StringFormats}"
				SelectedItem="{Binding StringFormat, ElementName=myCurrencyTextBox, Mode=TwoWay}" HorizontalAlignment="Left" Width="177" Height="31" VerticalAlignment="Top" />
        </Grid>
        <Label x:Name="label" Content="DATA VALIDATION" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
        <Label x:Name="label_Copy" Content="MINIMUM/MAXIMUM VALUE" HorizontalAlignment="Left" Margin="10,82,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
        <Grid Margin="10,118,10,0" Height="30" VerticalAlignment="Top">
            <currency:CurrencyTextBox x:Name="ctbMinValue" HorizontalAlignment="Left" 
				TextWrapping="Wrap" VerticalAlignment="Top" Height="30" Width="239"/>
            <TextBlock
				Grid.Column="0"
				Margin="294,3,0,5"
				VerticalAlignment="Center"
				Text="Set MinimumValue:"
				TextAlignment="Right" HorizontalAlignment="Left" Width="172" />
            <currency:CurrencyTextBox HorizontalAlignment="Left" Margin="488,0,0,0" 
				x:Name="ctbMinimum"
				Number="{Binding MinimumValue, ElementName=ctbMinValue, Mode=TwoWay}"
				TextWrapping="Wrap" VerticalAlignment="Top" Height="30" 
				Width="176" StringFormat="n2" Text="0.00"/>
        </Grid>
        <Grid Margin="10,153,10,0" Height="30" VerticalAlignment="Top">
            <currency:CurrencyTextBox x:Name="ctbMaxValue" HorizontalAlignment="Left" 
				TextWrapping="Wrap" VerticalAlignment="Top" Height="30" Width="239"/>
            <TextBlock
				Grid.Column="0"
				Margin="294,3,0,5"
				VerticalAlignment="Center"
				Text="Set MaximumValue:"
				TextAlignment="Right" HorizontalAlignment="Left" Width="172" />
            <currency:CurrencyTextBox HorizontalAlignment="Left" Margin="488,0,0,0" 
				x:Name="ctbMaximum"
				Number="{Binding MaximumValue, ElementName=ctbMaxValue, Mode=TwoWay}"
				TextWrapping="Wrap" VerticalAlignment="Top" Height="30" 
				Width="176" StringFormat="n2" Text="0.00"/>
        </Grid>
        <Label Content="CANSHOWCALCULPANEL - ADD/REMOVE VALUE POPUP" HorizontalAlignment="Left" Margin="10,188,0,0" VerticalAlignment="Top" FontWeight="Bold"/>
        <Grid Margin="10,224,10,0" Height="31" VerticalAlignment="Top">
            <currency:CurrencyTextBox x:Name="currencyTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Width="239" Height="30" CanShowAddPanel="True" UpDownRepeat="15"/>
            <Label Content="Hit Enter Key for ADD/REMOVE value" HorizontalAlignment="Left" Margin="297,0,0,0" VerticalAlignment="Top"/>
        </Grid>
        <currency:CurrencyTextBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="239" Height="30" UpDownRepeat="15" Margin="27,266,0,0" StringFormat="P2"/>
    </Grid>
</Window>
